.class public final Lcn/cheln/explorer/util/SDcardCheck;
.super Ljava/lang/Object;


# static fields
.field public static a:I

.field public static b:Z

.field public static c:Lcn/cheln/explorer/util/SDcardCheck$MediaScannerBroadcast;

.field public static d:Landroid/view/View;

.field private static e:Landroid/content/IntentFilter;

.field private static f:Landroid/content/Context;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const/4 v0, 0x0

    sput v0, Lcn/cheln/explorer/util/SDcardCheck;->a:I

    return-void
.end method

.method public static a(Landroid/content/BroadcastReceiver;)V
    .locals 1

    sget-object v0, Lcn/cheln/explorer/util/SDcardCheck;->f:Landroid/content/Context;

    invoke-virtual {v0, p0}, Landroid/content/Context;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    return-void
.end method

.method public static a(Landroid/content/Context;Landroid/content/BroadcastReceiver;)V
    .locals 2

    sget-object v0, Lcn/cheln/explorer/util/SDcardCheck;->e:Landroid/content/IntentFilter;

    if-eqz v0, :cond_0

    sget-object v0, Lcn/cheln/explorer/util/SDcardCheck;->e:Landroid/content/IntentFilter;

    :goto_0
    invoke-virtual {p0, p1, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    sput-object p0, Lcn/cheln/explorer/util/SDcardCheck;->f:Landroid/content/Context;

    return-void

    :cond_0
    new-instance v0, Landroid/content/IntentFilter;

    const-string v1, "android.intent.action.MEDIA_SCANNER_STARTED"

    invoke-direct {v0, v1}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    sput-object v0, Lcn/cheln/explorer/util/SDcardCheck;->e:Landroid/content/IntentFilter;

    const-string v1, "android.intent.action.MEDIA_MOUNTED"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    sget-object v0, Lcn/cheln/explorer/util/SDcardCheck;->e:Landroid/content/IntentFilter;

    const-string v1, "android.intent.action.MEDIA_UNMOUNTED"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    sget-object v0, Lcn/cheln/explorer/util/SDcardCheck;->e:Landroid/content/IntentFilter;

    const-string v1, "android.intent.action.MEDIA_REMOVED"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    sget-object v0, Lcn/cheln/explorer/util/SDcardCheck;->e:Landroid/content/IntentFilter;

    const-string v1, "android.intent.action.MEDIA_SHARED"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    sget-object v0, Lcn/cheln/explorer/util/SDcardCheck;->e:Landroid/content/IntentFilter;

    const-string v1, "android.intent.action.MEDIA_BAD_REMOVAL"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    sget-object v0, Lcn/cheln/explorer/util/SDcardCheck;->e:Landroid/content/IntentFilter;

    const-string v1, "android.intent.action.MEDIA_SCANNER_FINISHED"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    sget-object v0, Lcn/cheln/explorer/util/SDcardCheck;->e:Landroid/content/IntentFilter;

    const-string v1, "file"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addDataScheme(Ljava/lang/String;)V

    sget-object v0, Lcn/cheln/explorer/util/SDcardCheck;->e:Landroid/content/IntentFilter;

    goto :goto_0
.end method

.method public static a(Lcom/direction/hold/ui/CommonActivity;)V
    .locals 1

    sget-object v0, Lcn/cheln/explorer/util/SDcardCheck;->c:Lcn/cheln/explorer/util/SDcardCheck$MediaScannerBroadcast;

    if-eqz v0, :cond_0

    sget-object v0, Lcn/cheln/explorer/util/SDcardCheck;->c:Lcn/cheln/explorer/util/SDcardCheck$MediaScannerBroadcast;

    invoke-virtual {v0, p0}, Lcn/cheln/explorer/util/SDcardCheck$MediaScannerBroadcast;->a(Lcom/direction/hold/ui/CommonActivity;)V

    :cond_0
    return-void
.end method

.method public static a()Z
    .locals 2

    invoke-static {}, Landroid/os/Environment;->getExternalStorageState()Ljava/lang/String;

    move-result-object v0

    const-string v1, "mounted"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    return v0
.end method

.method public static a(Landroid/app/Activity;)Z
    .locals 4

    const/4 v3, 0x0

    const/4 v2, 0x0

    invoke-static {}, Lcn/cheln/explorer/util/SDcardCheck;->a()Z

    move-result v0

    if-nez v0, :cond_0

    invoke-static {p0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    const v1, 0x7f030011

    invoke-virtual {v0, v1, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v0

    sput-object v0, Lcn/cheln/explorer/util/SDcardCheck;->d:Landroid/view/View;

    const v1, 0x7f080080

    invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    const v1, 0x7f050042

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(I)V

    sget-object v0, Lcn/cheln/explorer/util/SDcardCheck;->d:Landroid/view/View;

    invoke-virtual {v0, v2}, Landroid/view/View;->setVisibility(I)V

    const v0, 0x1030005

    invoke-virtual {p0, v0}, Landroid/app/Activity;->setTheme(I)V

    sget-object v0, Lcn/cheln/explorer/util/SDcardCheck;->d:Landroid/view/View;

    invoke-virtual {p0, v0}, Landroid/app/Activity;->setContentView(Landroid/view/View;)V

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    sput-object v3, Lcn/cheln/explorer/util/SDcardCheck;->d:Landroid/view/View;

    move v0, v2

    goto :goto_0
.end method

.method public static b()Z
    .locals 1

    invoke-static {}, Lcn/cheln/explorer/util/SDcardCheck;->a()Z

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method
